<!--
 * @Descripttion: 提货备注分行信息
 * @version:
 * @Author: Allen
 * @Date: 2021-06-21
 * @LastEditors: Connor
 * @LastEditTime: 2021-06-21 14:56:40
-->
<template>
  <div>
    <span v-if="this.data.takeDeliveryOrderType === 10">海运</span>
    <span v-else-if="this.data.takeDeliveryOrderType === 20">空运</span>
    <span v-else-if="this.data.takeDeliveryOrderType === 30">海运 + 空运</span>
    <p v-for="(item, index) in sysRemarks" :key="index">{{ item }}</p>
  </div>
</template>
<script>
import Table from "../../../../yg/layout/main/page/wrapper/Table.vue";
export default {
  components: { Table },
  props: ["field", "data"],
  data() {
    return {
      sysRemarks: []
    };
  },
  mounted() {
    this.driversSysRemark();
  },
  methods: {
    driversSysRemark() {
      // debugger;
      let number = 0;
      if (this.data.sysRemark) {
        for (let index = 0; index < this.data.sysRemark.length; index++) {
          // if (index == 0) {
          //   if (this.data.sysRemark.slice(number, 5) == "海运+空运") {
          //     this.sysRemarks.push(this.data.sysRemark.slice(number, 5));
          //     number = 5;
          //   } else if (
          //     this.data.sysRemark.slice(number, 2) == "海运" ||
          //     this.data.sysRemark.slice(number, 2) == "空运"
          //   ) {
          //     this.sysRemarks.push(this.data.sysRemark.slice(number, 2));
          //     number = 2;
          //   }
          // }
          const element = this.data.sysRemark.slice(number, number + 8);
          if (this.data.sysRemark.length < 8) {
            this.sysRemarks.push(element);
            return;
          } else if (this.data.sysRemark.length - index >= 8) {
            this.sysRemarks.push(element);
          } else {
            return;
          }
          number = number + 8;
        }
      }
    }
  }
};
</script>
<style scoped></style>

<style lang="scss">
.row-item {
  color: #3f4652;
  line-height: 28px;
  margin-bottom: 14px;
}
</style>
